package com.nx.samuel.dubbo_util;

import org.apache.dubbo.common.bytecode.Proxy;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;


public class ProxyTest {

    public static void main(String[] args) {

        HelloService helloService = (HelloService) Proxy.getProxy(HelloService.class).newInstance(new InvocationHandler() {
            @Override
            public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
                System.out.println(method.getName());
                return null;
            }
        });

        helloService.sayHello();
        helloService.getGrade();
    }
}
